// // Copyright (c) 2009 All Right Reserved // // vl // // 2009-01-01 // Contains ... using System; using System.Text; using System.Xml.Serialization; namespace LargoCommon.Music { /// Item of general musical request. /// /// Gen Request Item. [Serializable] [XmlRoot] public struct GeneralRequestItem { /// Initializes a new instance of the GeneralRequestItem struct. Serializable. /// General musical property. /// Weight of the request. /// Requested value. public GeneralRequestItem(GenProperty property, float weight, float? value) : this() { this.Property = property; this.Weight = weight; this.Value = value; } /// Gets musical property. /// Property description. public GenProperty Property { get; } /// Gets name. /// Property description. public string Name => this.Property.ToString(); /// Gets weight. /// Property description. public float Weight { get; } /// Gets value. /// Property description. public float? Value { get; } #region String representation /// String representation of the object. /// Returns value. public override string ToString() { var s = new StringBuilder(); s.AppendFormat("Item {0,12}: Weight={1,5:F1}, Value={2,5:F1}", this.Property, this.Weight, this.Value); return s.ToString(); } #endregion } }